<template>
  <view class="info-page">
    <nav-bar title="个人信息" backgroundColor="#115BAA" titleColor="#FFF"></nav-bar>
    <view class="info-item" v-for="(item, index) in userInfoConfig" :key="index">
      <view class="label">{{ item.label }}</view>
      <view class="value-box">
        <view class="img-box" v-if="item.isImg"></view>
        <view class="value" v-else>{{ userInfo[item.key] }}</view>
        <uni-icons type="right" size="16" color="#808080"></uni-icons>
      </view>
    </view>
    <view class="proficient">
      <view class="label">我的擅长</view>
      <view class="value-box" @click="clickProficient">
        <view class="value">{{ userInfo.proficient || '添加' }}</view>
        <uni-icons type="right" size="16" color="#808080"></uni-icons>
      </view>
    </view>
    <view class="qualification">
      <view class="label">认证</view>
      <view class="value-box" @click="clickQualification">
        <view class="value">{{ userInfo.qualification }}</view>
        <uni-icons type="right" size="16" color="#808080"></uni-icons>
      </view>
    </view>
    <view class="synopsis">
      <view class="label">
        简介
        <uni-icons class="right-icon" type="right" size="16" color="#808080"></uni-icons>
      </view>
      <view class="value">{{ userInfo.synopsis }}</view>
    </view>
  </view>
</template>

<script>
  export default {
    name: 'EditUserInfo',
    data() {
      return {
        userInfoConfig: [
          { label: '头像', key: 'headImg', isImg: true },
          { label: '姓名', key: 'userName' },
          { label: '电话', key: 'phone' }
        ],
        userInfo: {
          userName: '曹静',
          phone: '13686868686',
          proficient: '',
          qualification: '康复师',
          synopsis: '我是一名资深室内装修设计师，从业多年，拥有丰富的设计经验和创意思维。我热爱设计，追求极致的空间美学，注重细节和品质。我希望通过我的设计，为每一位业主打造一个舒适、美观、实用的家居环境。'
        }
      }
    },
    onLoad() {},
    methods: {
      clickProficient() {
        uni.navigateTo({
          url: '/subPages/physicianMine/myResource/myProficient'
        })
      },
      clickQualification() {
        uni.navigateTo({
          url: '/subPages/physicianMine/myResource/myQualification'
        })
      }
    }
  }
</script>
<style lang="scss">
  .info-page {
    height: 100vh;
    background-color: #F0F3F5;
    .info-item,
    .proficient,
    .qualification {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 20rpx 30rpx;
      margin-bottom: 2rpx;
      background-color: #FFF;
      .label {
        font-size: 28rpx;
        font-weight: 500;
        color: #000;
      }
      .value-box {
        flex: 1;
        display: flex;
        justify-content: flex-end;
        align-items: center;
        color: #808080;
        .value {
          margin-right: 16rpx;
        }
        .img-box {
          width: 100rpx;
          height: 100rpx;
          margin-right: 16rpx;
          border-radius: 50rpx;
          background-color: #115BAA;
        }
      }
    }
    .proficient,
    .qualification {
      margin: 29rpx 0;
    }
    .synopsis {
      padding: 20rpx 30rpx;
      background-color: #FFF;
      .label {
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
        .right-icon {
          flex: 1;
          text-align: right;
        }
      }
      .value {
        margin-top: 8rpx;
        font-size: 24rpx;
        line-height: 28rpx;
        color: #808080;
      }
    }
  }
</style>
